Subject: Re: amazing disappearing Write() s
From: [email-masked] (Christoph Feck IRZ)
Date: Sat, 23 Apr 1994 18:52:58 GMT
Newsgroups: comp.sys.amiga.programmer

In article <[email-masked]>, [email-masked] writes:
> 
> I have been writing a file-io intensive program (Open/Read/Write/Close) and
> find an erratic/random problem: sometime the changes made by Write don't stay
> made after a Close.  The changes are in effect for subsequent reads in the
> same run, but the changes suddenly disappear when the program compeletes!
> Do I need to Flush() a file before closing it?  Does anyone have any ideas?

Close() does a Flush() itself.  But you must Flush() if you change
data transfer direction with buffered files (FRead/FWrite).

> Also, there is an OpenFromLock() but no LockFromFH() - why not?  Does Open()

It's called DupLockFromFH().  The file will not be closed, unlike
OpenFromLock() where the lock is released.

> automatically Lock a file and Close UnLock() ?  If so, is it always ACCESS_
> WRITE ?  How do you control it iit is automatic?

It should be ACCESS_READ for MODE_OLD and ACCESS_WRITE otherwise.
Ralph? :)

3k// Christoph Feck, TowerSystems - BOOPSI Class Development
\X/ Amiga - Intuition inside.